class Solution:
	# @param {string[]} tokens
	# @return {integer}
	def evalRPN(self, tokens):
		opt = {
			'+': (lambda x,y: x + y),
			'-': (lambda x,y: x - y),
			'*': (lambda x,y: x * y),
			'/': (lambda x,y: int(x*1.0 / y))
			}
		stk = []
		for c in tokens:
			if c in opt:
				b = int(stk.pop())
				a = int(stk.pop())
				stk.append(opt[c](a,b))
			else:
				stk.append(c)
		return int(stk[-1])

if __name__ == '__main__':
	print Solution().evalRPN(["10","6","9","3","+","-11","*","/","*","17","+","5","+"])